package com.cdl.statictest;

import java.util.Objects;

/**
 * @author cdl
 * &#064;date  2025/10/4
 */
public class Persion {

    private String name;
    private int age;
    private String gender;


    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getGender() {
        return gender;

    }

    public Persion() {
    }
    public Persion(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "Persion{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Persion persion = (Persion) o;
        return age == persion.age && Objects.equals(name, persion.name) && Objects.equals(gender, persion.gender);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, gender);
    }

}
